<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style>
		* {
		    margin: 0;
		    padding: 0;
		    box-sizing: border-box;
		}
		body {
		    font-weight: 400;
		    font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
		}
		td,
		th {
		    padding: 8px;
		    padding: .5rem;
		}
		th {
		    text-align: left;
		    font-weight: 300;
		    font-size: 20px;
		    font-size: 1.25rem;
		}
		td {
		    font-family: 'Avenir Next', 'Segoe UI', 'Lucida Grande', sans-serif;
		}
		.table {
		    width: 100%;
		    padding: 16px;
		    padding: 1rem;
		}
		.table__heading {
		    border-bottom: 2px solid #FFC842;
		}
		@media (max-width: 32rem) {
		    .table__heading {
		        display: none;
		    }
		    .table__content {
		        display: block;
		        padding: .5rem 0;
		    }
		    .table__row {
		        margin: .25rem 1rem;
		        padding: .5rem 0;
		        display: block;
		        border-bottom: 2px solid #FFC842;
		    }
		    .table__content:before {
		        content: attr(data-heading);
		        display: inline-block;
		        width: 5rem;
		        margin-right: .5rem;
		        color: #999;
		        font-size: .75rem;
		        font-weight: 700;
		        font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
		        text-transform: uppercase;
		        letter-spacing: 2px;
		    }
			a{
				margin: 0px; padding: 0px; color: rgb(87, 107, 149); font-family: mp-quote, -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif; font-size: 17px; letter-spacing: normal; text-align: justify; text-transform: none;
			}
		}
		</style>
	</head>
	<body>
	<div id="div">
	<input type="text" id="start" placeholder="开始时间(默认当天)\"/>-<input type="text" id="end" placeholder="结束时间(默认当天)"/>
	<input type="button" onclick="exportHtml();" value="生成模版" name="" style="height:30px;">
	</div>
	<table class="table">
		<thead>
		<tr>
			<th class="table__heading" colspan="2">商品列表</th>
		</tr>
		</thead>
		<tbody id="tbody">

		</tbody>

	</table>
	</body>
	<script language="javascript" src="./js/jquery-2.0.3.min.js" type="text/javascript"> </script>
	<script language="javascript" type="text/javascript">
		function exportHtml(){
			var formData = new FormData();
			formData.append("start",$("#start").val());
			formData.append("end",$("#end").val());
			//formData.append("service",'App.Passion.UploadFile');
			//formData.append("token",token);
			$.ajax({
				url:'/exportHtml', /*接口域名地址*/
				type:'post',
				data: formData,
				contentType: false,
				processData: false,
				success:function(res){
					if(res.length == 0) {
						alert("未查找到合适的记录");
						return;
					}else{
						$("#div").hide();
						var html = '';
						for(var i =0;i<res.length;i++) {
							html +='<tr className="table__row">';
							html +='<td class="table__content" data-heading="Name"><a target="_blank" href="http://2m3p7-44.pospal.cn/m#/details/'+res[i].id+'"><img style="width: 300px;height:300px;" src="'+res[i].path+'" alt="" onerror="_yb.errProdImg(this)"></a></td>';
							html +='<td class="table__content" data-heading="Type"><a target="_blank" href="http://2m3p7-44.pospal.cn/m#/details/'+res[i].id+'" textvalue="'+res[i].name+'" linktype="text" imgurl="" tab="outerlink">'+res[i].name+'<br/><span style="text-decoration:line-through;">原价￥'+res[i].attribute1+'</span><br/><span>现价￥'+res[i].customerPrice+'</span></a></td>';
							html +='</tr>';
						}
						html += '</table>';
						$("#tbody").html(html);
					}

				}
			})
		}
	</script>
</html>
